home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-27 | 555 b | 30 lines | [TEXT/CWIE] |
- //
- // CObjectMaker.h
- //
- // Template class CObjectMaker
- // A template for C++ classes that construct QuickDraw 3D objects.
- //
- // This is an abstract class.
- // Everything is inline, so there is no *.cp file.
- //
- // by James Jennings
- // November 26, 1995
- //
-
- #pragma once
-
- template <class T>
- class CObjectMaker {
- protected:
- CObjectMaker() : mObject(0) {}
- virtual ~CObjectMaker()
- { if (mObject) ::Q3Object_Dispose(mObject); }
-
- virtual void Make() = 0;
- public:
- T Get()
- { if (!mObject) Make(); return mObject; }
- protected:
- T mObject;
- };
-